<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>热销商品报表</title>
<body class="withvernav">
<style type="text/css">
	thead tr td{
		vertical-align: middle;background-color: #CCCCCC; border: 1px solid #000000 !important ; text-align: center;
	}
	.stdtable tbody tr td {padding:3px 0px !important;font-size:12px !important;}
	.width100{padding:5px !important;}
	.tableoptions button {
    background: #f5f5f5;
	}
</style>
<div class="bodywrapper"> {{include file='/public/leftmenu.tpl'}}
  <div class="centercontent">
    <div class="pageheader notab">
      <h1 class="pagetitle">热销商品报表<span class="pagedesc" style="font-size:14px;">(只统计直发订单)</span></h1>
     
</div>
<!--pageheader-->
    
    <div id="contentwrapper" class="contentwrapper" >
      <div id="basicform" class="subcontent">
          <!--搜索栏-->
           
    <form class="stdform stdform2" method="get" action="/report/salesGoodsRank">
    <div class="tableoptions">
      订单时间：
       <input type="text"  name="starttime" value="{{$starttime}}" onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" /> - <input type="text"  name="endtime" value="{{$endtime}}" onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" />
       <span style="display:none">所属平台: 
     <select id="platform" name="platform">
            <option value="">-请选择-</option>
            <option value="ebay">ebay</option>
            <option value="Amazon">Amazon</option>
            <option value="1号店">1号店</option>
            <option value="淘宝">淘宝</option>
            <option value="Tmall">Tmall</option>
            <option value="ioffer">ioffer</option>
        </select>
       &nbsp;&nbsp;</span>

       
       

        排序：
        <select name="ordertype">
<option value="sell_total" {{if $ordertype=='sell_total'}} selected{{/if}}>销售数量</option>
<option value="goods_amount_total" {{if $ordertype=='goods_amount_total'}} selected{{/if}}>交易金额</option>
</select>

    <select name="good_source" id="good_source">
        <option value="">商品来源</option>
				{{foreach from = $factorylist key=key item=li}}
                <option value="{{$li.id}}" {{if $good_source == $li.id}} selected{{/if}}>{{$li.name}}</option>
              {{/foreach}}
    </select>
<span id="search_list">{{$shopname|getstr:48:0}}</span>
       <input name="shopname" id="shopname" type="hidden" value="{{$shopname}}" />
       <span id="choose_shop_btn" style="border:1px solid #ccc;padding:6px 5px 7px;border-radius:3px;cursor:pointer;" onClick="getShopList()">选择店铺 <img src="/fuman/images/search_down.png" width="14" height="21" align="absmiddle" style="margin-bottom:-4px;"></span>

         商品SKU:<input type="text"  name="goods_sku" value="{{$goods_sku}}"  class="width100"> 
         显示条数：
         <input type="text"  name="rownum" value="{{$rownum}}"  class="width100" style="width:60px;">&nbsp; 
        <button class="btn btn_orange btn_search radius50">Search</button>
        &nbsp;{{if $list[0] neq  ''}}
        <span class="page" style="background-color#fff;border:none;"><a href="javascript:exportExl();">导出结果到Excel</a></span>
        {{/if}}
        总记录数：<strong style="color:red;">{{$total_datas}}</strong> 条
	</div>
    </form>
    <!--搜索栏结束-->

             <table cellpadding="0" cellspacing="0" border="0" class="stdtable" width="1600">
          
            <thead>
              <tr valign="top" class="tableheader" bgcolor="#EEEEEE">
      <td style="vertical-align:middle;background-color:#CCCCCC;border:1px solid #000000;text-align:center;" rowspan="2" width="90" bgcolor="#EEEEEE"><p>商品编号</p></td>
      <td style="vertical-align:middle;background-color:#CCCCCC;border:1px solid #000000;text-align:center;" rowspan="2" bgcolor="#EEEEEE"><p>名称</p></td>
      <td style="vertical-align:middle;background-color:#CCCCCC;border:1px solid #000000;text-align:center;" rowspan="2" width="40"><p>重量</p></td>
      <td style="vertical-align:middle;background-color:#CCCCCC;border:1px solid #000000;text-align:center;" colspan="3" align="center">收入</td>
      <td style="vertical-align:middle;background-color:#CCCCCC;border:1px solid #000000;text-align:center;" colspan="5" align="center">支出</td>
      <td style="vertical-align:middle;background-color:#CCCCCC;border:1px solid #000000;text-align:center;" rowspan="2"  width="50"><p>毛利</p></td>
      <td style="vertical-align:middle;background-color:#CCCCCC;border:1px solid #000000;text-align:center;" rowspan="2"><p>毛利率(%)</p></td>
      <td style="vertical-align:middle;background-color:#CCCCCC;border:1px solid #000000;text-align:center;" rowspan="2"><p>销售数量</p></td>
      <td style="vertical-align:middle;background-color:#CCCCCC;border:1px solid #000000;text-align:center;" rowspan="2"><p>平均单天销量</p></td>
      </tr>
    <tr valign="top" class="tableheader" bgcolor="#EEEEEE">
      <td style="vertical-align:middle;background-color:#CCCCCC;border:1px solid #000000;text-align:center;" width="50">交易金额</td>
      <td style="vertical-align:middle;background-color:#CCCCCC;border:1px solid #000000;text-align:center;" width="50">实收运费</td>
      <td style="vertical-align:middle;background-color:#CCCCCC;border:1px solid #000000;text-align:center;" width="50">小计</td>
      <td style="vertical-align:middle;background-color:#CCCCCC;border:1px solid #000000;text-align:center;" width="50">商品成本</td>
      <td style="vertical-align:middle;background-color:#CCCCCC;border:1px solid #000000;text-align:center;" width="50">预估运费</td>
      <td style="vertical-align:middle;background-color:#CCCCCC;border:1px solid #000000;text-align:center;">平台交易费</td>
      <td style="vertical-align:middle;background-color:#CCCCCC;border:1px solid #000000;text-align:center;">paypal交易费</td>
      <td style="vertical-align:middle;background-color:#CCCCCC;border:1px solid #000000;text-align:center;" width="50" align="center">小计</td>
    </tr>
            </thead>
          
             {{foreach from=$list item=res key=key}}
            <tr>
              <td class="head1" align="center"><a href="/product/productlist?other={{$res.goods_sn}}" target="_blank">{{$res.goods_sn}}</a></td>
                <td class="head0" align="center" title="{{$res.goods_name}}">{{$res.goods_name|getstr:24:0}}</td>
                <td class="head1" align="center" style="border-right:1px solid #000;">{{$res.goods_weight}}</td>
              <td class="head1" align="center" style="border-left:1px solid #000;">{{$res.goods_amount_total}}</td>
                <td class="head1" align="center">{{$res.shipping_fee_total}}</td>
                <td class="head0" align="center" style="border-right:1px solid #000;">{{$res.goods_amount_total + $res.shipping_fee_total}}</td>
                <td class="head1" align="center" style="border-left:1px solid #000;">{{$res.costprice_total}}</td>
              <td class="head0" align="center">{{$res.shipping_expectfee_total}}</td>
                <td class="head0" align="center">{{$res.platform_fee_total}}</td>
                <td class="head0" align="center">{{$res.payfee_total}}</td>
              <td class="head0" align="center" style="border-right:1px solid #000;">{{$res.costprice_total+$res.platform_fee_total + $res.payfee_total+$res.realexpress_fre+$res.shipping_expectfee_total}}</td>
                <td class="head0" align="center" style="border-left:1px solid #000;">
                {{$res.goods_amount_total+ $res.shipping_fee_total-$res.costprice_total-$res.platform_fee_total-$res.payfee_total-$res.realexpress_fre-$res.shipping_expectfee_total}}</td>
                <td class="head0" align="center">{{$res.maoliv}}%</td>
                <td class="head1" align="center">{{$res.sell_total}}</td>
                <td class="head1" align="center">{{$res.day_sales}}</td>
               </tr>
            {{/foreach}}
            <tr>
            <td class="head1" align="center"><strong>合计</strong></td>
                <td class="head1" align="center">&nbsp;</td>
                <td class="head1" align="center">&nbsp;</td>
                <td class="head1" align="center"><font color="#FF0000"><B>{{$total.goods_amount_total}}</B></font></td>
                <td class="head1" align="center"><font color="#FF0000"><B>{{$total.shipping_fee_total}}</B></font></td>
                <td class="head1" align="center"><font color="#FF0000"><B>{{$total.have_total}}</B></font></td>
                <td class="head1" align="center"><font color="#FF0000"><B>{{$total.costprice_total}}</B></font></td>
                <td class="head1" align="center"><font color="#FF0000"><B>{{$total.shipping_expectfee_total}}</B></font></td>
                <td class="head1" align="center"><font color="#FF0000"><B>{{$total.platform_fee_total}}</B></font></td>
                <td class="head1" align="center"><font color="#FF0000"><B>{{$total.payfee_total}}</B></font></td>
                <td class="head1" align="center"><font color="#FF0000"><B>{{$total.give_total}}</B></font></td>
                <td class="head1" align="center"><font color="#FF0000"><B>{{$total.maoli_total}}</B></font></td>
                <td class="head1" align="center"><font color="#FF0000"><B>{{$total.maoliv_avg}}%</B></font></td>
                <td class="head1" align="center"><font color="#FF0000"><B>{{$total.sell_total}}</B></font></td>
                <td class="head1" align="center"><font color="#FF0000"><B>{{$total.day_sales}}</B></font></td>
            </tr>
          </table>
      </div></div>
</div>
<div style="position:absolute;z-index:999;top:105px;border:1px solid #666;left:220px;width:870px;background:#f5f5f5;padding:6px 10px;height:450px;margin-bottom:40px;display:none;" id="ajax_box">
<div style="padding-top:8px;padding-left:12px;height:28px;"><h4 style="float:left">选择要搜索的店铺</h4><span style="float:right">
  <input type="button" name="button" id="button" onClick="setShopInfo()" value="确定选择">&nbsp;&nbsp;
  <input type="button" value="关闭弹层" onClick="closeShowBox()">
</span></div>
<div id="shop_box" style="height:400px;overflow:auto"></div>
</div>
<script type="text/javascript" src="/fuman/js/report.js"></script>
<script type="text/javascript" src="/fuman/js/oversea.js"></script>
<script language="javascript">
function addorder(){
	$('#addstorageform').modal('show');	
}

function getshopName()
{
	var platformID = $("#platformID").val();
	
	if(platformID)
	{
		 $.post("/orderlist/ajaxbutton", {"op": "getshoplist", "platformID": platformID},
		 function (data) {
			 if(data)
			 {
				 var tmp="<option value=''>店铺</option>";
				 for (var i = 0; i < data.length; i++) {
                    tmp += '<option value='+data[i].id+'>'+data[i].name+'</option>'
					
                }
				$("#shopname").html(tmp);
			 }
		}, "json");
	}
}
</script>
</body>
</html>